package com.cskaoyan.controller;

import com.cskaoyan.bean.Admin;
import com.cskaoyan.bean.Permission;
import com.cskaoyan.bean.Permissions;
import com.cskaoyan.mapper.PermissionMapper;
import com.cskaoyan.service.ServiceImpl;
import com.cskaoyan.service.ServiceO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class premissions {


    @Autowired
    PermissionMapper permissionMapper;
    @Autowired
    ServiceO serviceO;
    @RequestMapping("permissions")
    public void get (@RequestBody Permissions permissions){
        //插入assignedPermissions
//        List<String> assignedPermissions = permissions.getAssignedPermissions();
//        serviceO.create(assignedPermissions);
        List<Permissions.SystemPermissionsBean> systemPermissions = permissions.getSystemPermissions();
        serviceO.createsys(systemPermissions);

        System.out.println("这是佩咪行");

    }
}
